*****************************************************************************************************
*WA DID Analysis.
*When Women Run, Voters Will Follow (Sometimes):
**Examining the Mobilizing Effect of Female Candidates in the 2014 and 2018 Midterm Elections
*Safarpour, Wyckoff Gaynor, Rouse, and Swers.
*****************************************************************************************************

*Import Data.
import delimited "/Users/ACS/Dropbox/When Women Run/Revision_PoliticalBehavior/R&R Part 2/Publication Docs/Replication Data and Code/WADIDReplicationData.csv", clear



*Run model with generation dummies (Table 3 in main text of paper).
       *Note: using BabyBoomers as the excluded category.
*OLS DiD with individual level control variables and clustered SEs.
reg voted i.year2018 i.treat i.year2018#i.treat priorvoting femalenum generationznum millennialsnum generationxnum silentgenerationnum, cluster(uniqueid)



*Confirm results using probit and logit.
       
probit voted i.year2018 i.treat i.year2018#i.treat priorvoting femalenum generationznum millennialsnum generationxnum silentgenerationnum, cluster(uniqueid)

margins i.year2018##i.treat

*(Treated 2018-Treated2014)-(Control2018-Control2014)
*(.6890448  - .5247547)-(.6684552 -.5251749)
*Effect=0.0210098.

logit voted i.year2018 i.treat i.year2018#i.treat priorvoting femalenum generationznum millennialsnum generationxnum silentgenerationnum, cluster(uniqueid)

margins i.year2018##i.treat

*(Treated 2018-Treated2014)-(Control2018-Control2014)
*(.6883742   - .5236197 )-(.6674793  -.5233663 )
*Effect=0.0206415.

*Results hold across alternative specifications.

